import style from '../../../src/assets/style/global.scss'
let pagingHeight = 50 // 默认分页器高度
try {
  if (style && style.pagingHeight) {
    pagingHeight = parseInt(style.pagingHeight) || 0
  }
} catch (e) {}

export const mainMixin = {
  data() {
    return {
      tableHeight: 500
    }
  },
  mounted() {
    const el = this.$el
    if (!el || !el.querySelector) return
    const ref = el.querySelector('.main-body')
    if (!ref) return
    const windowHeight = window.document.documentElement.clientHeight
    this.tableHeight = windowHeight - (ref.offsetTop - el.offsetTop) - pagingHeight - 60 // 表头60
  }
}
